﻿namespace UnityEditor
{
    using System;
    using UnityEngine;

    [CustomEditor(typeof(TextAsset)), CanEditMultipleObjects]
    internal class TextAssetInspector : Editor
    {
        private const int kMaxChars = 0x1b58;

        public override void OnInspectorGUI()
        {
            bool enabled = GUI.enabled;
            GUI.enabled = true;
            TextAsset target = base.target as TextAsset;
            if (target != null)
            {
                string targetName;
                if (base.targets.Length > 1)
                {
                    targetName = this.targetName;
                }
                else
                {
                    targetName = target.ToString();
                    if (targetName.Length > 0x1b58)
                    {
                        targetName = targetName.Substring(0, 0x1b58) + "...\n\n<...etc...>";
                    }
                }
                GUILayout.Box(targetName, "ScriptText", new GUILayoutOption[0]);
            }
            GUI.enabled = enabled;
        }
    }
}

